<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>通知消息模版</title>
	<meta name="decorator" content="default" />
	<script type="text/javascript">
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }

        function sendMessage(){
            top.$.jBox.open("iframe:${ctx}/business/messagetemplate/sendMassage", "添加班级",610,$(top.document).height()-240,{
                buttons:{"保存":"ok", "关闭":true}, bottomText:"为当前营期添加班级",submit:function(v, h, f){
                    if (v=="ok") {
                        h.find("iframe")[0].contentWindow.subm();//iframe中的提交
                        loading('正在提交，请稍等...');
                    }
                }, loaded:function(h){
                    $(".jbox-content", top.document).css("overflow-y","hidden");
                }
            });
		}
	</script>
</head>
<body style="overflow-x:scroll;">
<ul class="nav nav-tabs">
	<li class="active"><a href="${ctx}/business/messagetemplate/">通知消息模版列表</a></li>
	<shiro:hasPermission name="business:messagetemplate:edit">
		<li><a href="${ctx}/business/messagetemplate/form?sort=10">通知消息模版添加</a></li>
	</shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="messageTemplate" action="${ctx}/business/messagetemplate/" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
	<label>名称  ：</label>
	<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium" />&nbsp;
	<label>类型  ：</label>
	<form:select path="type" name="type" class="input-medium required">
		<form:option value="" label="请选择"/>
		<form:options items="${dic:getBusDictList('tb_message_template_type')}" itemLabel="label"
					  itemValue="value" htmlEscape="false"/>
	</form:select>
	&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" />
</form:form>
<tags:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
			<%--<th>ID</th>--%>
			<th>模板名称</th>
			<th>类型</th>
			<th>微信模板ID</th>
			<th>模板内容</th>
			<th>模版示例</th>
			<th>自定义属性名</th>
			<th>自定义属性值</th>
			<th>接收人</th>
			<th>地区</th>
			<th>状态</th>
			<th>可编辑</th>
			<th>创建人</th>
			<th>创建日期</th>
			<th>修改人</th>
			<th>更新日期</th>
			<th>备注</th>
		<shiro:hasPermission name="business:messagetemplate:edit">
			<th>操作</th>
		</shiro:hasPermission>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="messageTemplate">
		<tr id="${messageTemplate.id}">
				<%--<td><a href="${ctx}/business/messagetemplate/form?id=${messageTemplate.id}">${messageTemplate.id}</a></td>--%>
				<td>${messageTemplate.name}</td>
				<td>${dic:getLabelByValue(messageTemplate.type, 'tb_message_template_type')}</td>
				<td>${fn:substring(messageTemplate.weChatTemplateId,0,10)}...</td>
				<td>${fn:substring(messageTemplate.templateContent,0,10)}...</td>
				<td>${messageTemplate.templateExample}</td>
				<td>${messageTemplate.attributeName}</td>
				<td>${messageTemplate.attributeValue}</td>
				<td>${dic:getLabelByValue(messageTemplate.receive, 'tb_message_template_receive')}</td>
				<td>${messageTemplate.areaId}</td>
				<td>${dic:getLabelByValue(messageTemplate.status, 'tb_message_template_status')}</td>
				<td>${dic:getLabelByValue(messageTemplate.editable, 'tb_message_template_editable')}</td>
				<td>${messageTemplate.createBy}</td>
				<td>${messageTemplate.createDate}</td>
				<td>${messageTemplate.updateBy}</td>
				<td>${messageTemplate.updateDate}</td>
				<td>${messageTemplate.remarks}</td>
			<shiro:hasPermission name="business:messagetemplate:edit">
				<td><a href="${ctx}/business/messagetemplate/form?id=${messageTemplate.id}">修改</a>
					<a href="${ctx}/business/messagetemplate/delete?id=${messageTemplate.id}"
					   onclick="return confirmx('确认要删除吗？', this.href)">删除</a>
					<a href="${ctx}/business/messagetemplate/look?id=${messageTemplate.id}">查看</a>
				</td>
			</shiro:hasPermission>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>